Integrand size = 23, antiderivative size = 60 \[ \int \frac {c+d \sin (e+f x)}{3+b \sin (e+f x)} \, dx=\frac {d x}{b}+\frac {2 (b c-3 d) \arctan \left (\frac {b+3 \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {9-b^2}}\right )}{b \sqrt {9-b^2} f} \]
[Out]
Time = 0.05 (sec) , antiderivative size = 65, normalized size of antiderivative = 1.08, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {2814, 2739, 632, 210} \[ \int \frac {c+d \sin (e+f x)}{3+b \sin (e+f x)} \, dx=\frac {2 (b c-a d) \arctan \left (\frac {a \tan \left (\frac {1}{2} (e+f x)\right )+b}{\sqrt {a^2-b^2}}\right )}{b f \sqrt {a^2-b^2}}+\frac {d x}{b} \]
[In]
[Out]
Rule 210
Rule 632
Rule 2739
Rule 2814
Rubi steps \begin{align*} \text {integral}& = \frac {d x}{b}-\frac {(-b c+a d) \int \frac {1}{a+b \sin (e+f x)} \, dx}{b} \\ & = \frac {d x}{b}+\frac {(2 (b c-a d)) \text {Subst}\left (\int \frac {1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac {1}{2} (e+f x)\right )\right )}{b f} \\ & = \frac {d x}{b}-\frac {(4 (b c-a d)) \text {Subst}\left (\int \frac {1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac {1}{2} (e+f x)\right )\right )}{b f} \\ & = \frac {d x}{b}+\frac {2 (b c-a d) \arctan \left (\frac {b+a \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {a^2-b^2}}\right )}{b \sqrt {a^2-b^2} f} \\ \end{align*}
Time = 0.13 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.03 \[ \int \frac {c+d \sin (e+f x)}{3+b \sin (e+f x)} \, dx=\frac {d (e+f x)+\frac {2 (b c-3 d) \arctan \left (\frac {b+3 \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {9-b^2}}\right )}{\sqrt {9-b^2}}}{b f} \]
[In]
[Out]
Time = 1.19 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.27
method | result | size |
derivativedivides | \(\frac {\frac {2 \left (-d a +c b \right ) \arctan \left (\frac {2 a \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{b \sqrt {a^{2}-b^{2}}}+\frac {2 d \arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{b}}{f}\) | \(76\) |
default | \(\frac {\frac {2 \left (-d a +c b \right ) \arctan \left (\frac {2 a \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{b \sqrt {a^{2}-b^{2}}}+\frac {2 d \arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{b}}{f}\) | \(76\) |
risch | \(\frac {d x}{b}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i a \sqrt {-a^{2}+b^{2}}+a^{2}-b^{2}}{b \sqrt {-a^{2}+b^{2}}}\right ) d a}{\sqrt {-a^{2}+b^{2}}\, f b}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i a \sqrt {-a^{2}+b^{2}}+a^{2}-b^{2}}{b \sqrt {-a^{2}+b^{2}}}\right ) c}{\sqrt {-a^{2}+b^{2}}\, f}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i a \sqrt {-a^{2}+b^{2}}-a^{2}+b^{2}}{b \sqrt {-a^{2}+b^{2}}}\right ) d a}{\sqrt {-a^{2}+b^{2}}\, f b}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i a \sqrt {-a^{2}+b^{2}}-a^{2}+b^{2}}{b \sqrt {-a^{2}+b^{2}}}\right ) c}{\sqrt {-a^{2}+b^{2}}\, f}\) | \(282\) |
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 253, normalized size of antiderivative = 4.22 \[ \int \frac {c+d \sin (e+f x)}{3+b \sin (e+f x)} \, dx=\left [\frac {2 \, {\left (a^{2} - b^{2}\right )} d f x + \sqrt {-a^{2} + b^{2}} {\left (b c - a d\right )} \log \left (-\frac {{\left (2 \, a^{2} - b^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \, a b \sin \left (f x + e\right ) - a^{2} - b^{2} - 2 \, {\left (a \cos \left (f x + e\right ) \sin \left (f x + e\right ) + b \cos \left (f x + e\right )\right )} \sqrt {-a^{2} + b^{2}}}{b^{2} \cos \left (f x + e\right )^{2} - 2 \, a b \sin \left (f x + e\right ) - a^{2} - b^{2}}\right )}{2 \, {\left (a^{2} b - b^{3}\right )} f}, \frac {{\left (a^{2} - b^{2}\right )} d f x - \sqrt {a^{2} - b^{2}} {\left (b c - a d\right )} \arctan \left (-\frac {a \sin \left (f x + e\right ) + b}{\sqrt {a^{2} - b^{2}} \cos \left (f x + e\right )}\right )}{{\left (a^{2} b - b^{3}\right )} f}\right ] \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 425 vs. \(2 (53) = 106\).
Time = 13.67 (sec) , antiderivative size = 425, normalized size of antiderivative = 7.08 \[ \int \frac {c+d \sin (e+f x)}{3+b \sin (e+f x)} \, dx=\begin {cases} \frac {\tilde {\infty } x \left (c + d \sin {\left (e \right )}\right )}{\sin {\left (e \right )}} & \text {for}\: a = 0 \wedge b = 0 \wedge f = 0 \\\frac {\frac {c \log {\left (\tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} \right )}}{f} + d x}{b} & \text {for}\: a = 0 \\\frac {c x - \frac {d \cos {\left (e + f x \right )}}{f}}{a} & \text {for}\: b = 0 \\\frac {x \left (c + d \sin {\left (e \right )}\right )}{a + b \sin {\left (e \right )}} & \text {for}\: f = 0 \\\frac {2 c}{b f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} - b f} + \frac {d f x \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )}}{b f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} - b f} - \frac {d f x}{b f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} - b f} + \frac {2 d}{b f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} - b f} & \text {for}\: a = - b \\- \frac {2 c}{b f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + b f} + \frac {d f x \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )}}{b f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + b f} + \frac {d f x}{b f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + b f} + \frac {2 d}{b f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + b f} & \text {for}\: a = b \\- \frac {a d \log {\left (\tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + \frac {b}{a} - \frac {\sqrt {- a^{2} + b^{2}}}{a} \right )}}{b f \sqrt {- a^{2} + b^{2}}} + \frac {a d \log {\left (\tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + \frac {b}{a} + \frac {\sqrt {- a^{2} + b^{2}}}{a} \right )}}{b f \sqrt {- a^{2} + b^{2}}} + \frac {c \log {\left (\tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + \frac {b}{a} - \frac {\sqrt {- a^{2} + b^{2}}}{a} \right )}}{f \sqrt {- a^{2} + b^{2}}} - \frac {c \log {\left (\tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + \frac {b}{a} + \frac {\sqrt {- a^{2} + b^{2}}}{a} \right )}}{f \sqrt {- a^{2} + b^{2}}} + \frac {d x}{b} & \text {otherwise} \end {cases} \]
[In]
[Out]
Exception generated. \[ \int \frac {c+d \sin (e+f x)}{3+b \sin (e+f x)} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
none
Time = 0.30 (sec) , antiderivative size = 83, normalized size of antiderivative = 1.38 \[ \int \frac {c+d \sin (e+f x)}{3+b \sin (e+f x)} \, dx=\frac {\frac {{\left (f x + e\right )} d}{b} + \frac {2 \, {\left (\pi \left \lfloor \frac {f x + e}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (a\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + b}{\sqrt {a^{2} - b^{2}}}\right )\right )} {\left (b c - a d\right )}}{\sqrt {a^{2} - b^{2}} b}}{f} \]
[In]
[Out]
Time = 10.39 (sec) , antiderivative size = 343, normalized size of antiderivative = 5.72 \[ \int \frac {c+d \sin (e+f x)}{3+b \sin (e+f x)} \, dx=\frac {2\,d\,\mathrm {atan}\left (\frac {\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )}{b\,f}-\frac {a\,\left (d\,\ln \left (\frac {b\,\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )+a\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )+\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {b^2-a^2}}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )\,\sqrt {-\left (a+b\right )\,\left (a-b\right )}-d\,\ln \left (\frac {b\,\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )+a\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )-\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {b^2-a^2}}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )\,\sqrt {b^2-a^2}\right )-b\,c\,\ln \left (\frac {b\,\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )+a\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )+\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {b^2-a^2}}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )\,\sqrt {-\left (a+b\right )\,\left (a-b\right )}+b\,c\,\ln \left (\frac {b\,\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )+a\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )-\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {b^2-a^2}}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )\,\sqrt {b^2-a^2}}{b\,f\,\left (a^2-b^2\right )} \]
[In]
[Out]